import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// 引入初始化样式
import '@/styles/common.scss'

// 引入自定义指令
import { imgLazyLoad } from '@/directives/index.js'

// 引入全局组件插件
import { componentPlugin } from '@/components/index'

const app = createApp(App)

const pinia = createPinia()

app.use(pinia)
pinia.use(piniaPluginPersistedstate)
app.use(router)
app.use(imgLazyLoad)
app.use(componentPlugin)

app.mount('#app')
